package racing.client;
import java.io.Serializable;

/**
 * The message class use for the interaction between the client and server. 
 * 
 * @author Sarathit Sangtaweep 5510546182
 * @author Veerapat Teeravipark 5510547022
 * @version 2013
 */
public class Message implements Serializable  {
	private static final long serialVersionUID = 1L;
	private int id;
	private String message;
	private String command;

	/**
	 * Constructor of the class.
	 * @param command command of message class.
	 * @param id id of the client.
	 */
	public Message(String command,int id) {
		this.command = command;
		this.id = id;
	}
	
	/**
	 * Constructor of the class.
	 * @param command command of message class.
	 * @param message message of message class.
	 * @param id id of the client.
	 */
	public Message(String command,String message,int id) {
		this.message = message;
		this.command = command;
		this.id = id;
	}
	
	/**
	 * Constructor of the class.
	 * @param command command of message class.
	 */
	public Message(String command) {
		this.command = command;
	}
	
	/**
	 * Constructor of the class.
	 * @param command command of message class.
	 * @param message message of message class.
	 */
	public Message(String command, String message) {
		this.message = message;
		this.command = command;
	}

	/**
	 * Return ID.
	 * @return id of client.
	 */
	public int getID() {
		return id;
	}
	
	/**
	 * Return command.
	 * @return command of message class. 
	 */
	public String getCommand() {
		return command;
	}
	
	/**
	 * Return message.
	 * @return message of message class.
	 */
	public String getMessage() {
		return message;
	}
}
